/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CapadeDatos;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import modelo.beansemestreest;

/**
 *
 * @author jxtx
 */
public class daoversemestre {
public static  ArrayList datossemestre(){
        ArrayList lista = new ArrayList();
    try{
            Connection cn = ConexionBD.getInstance().getConnection();
            Statement stm = cn.createStatement();
            String sql ="CALL `proc_alumnosporsemstreycarrera`()"; // PROCEDIMIENTO ALMACENADO
            ResultSet rs =stm.executeQuery(sql);
            while (rs.next()){
                   beansemestreest semestre  = new beansemestreest();
                   semestre.setN_alum(rs.getInt(1));
                  semestre.setDescripcion(rs.getString(2));
                    semestre.setCod_carr(rs.getString(3));
                  semestre.setCod_periodo(rs.getString(4));
                                   lista.add(semestre);
            }
    }catch(Exception e){System.out.print(e);
   }return lista;
   }
}
